home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_054 / miditools / poster < prev    next >
Text File  |  1992-05-06  |  3KB  |  70 lines

  1. Article 1695 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!hplabs!pesnta!peora!petsd!fredc
  3. From: fredc@petsd.UUCP (Fred Cassirer)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Play and Record MIDI data
  6. Message-ID: <911@petsd.UUCP>
  7. Date: 25 Jan 87 02:12:38 GMT
  8. Organization: Perkin-Elmer DSG, Tinton Falls, N.J.
  9. Lines: 439
  10.  
  11.  
  12.  Recently there has been quite a bit of interest in MIDI on the AMIGA.  
  13.  I have a Yamaha DX-27 and have put together a few programs that will
  14.  play and record thru the MIDI I/F.  They aren't anything spectacular,
  15.  as a matter of fact all they do is play and record, placing the output
  16.  in an ASCII hex file (stdout).  I hope to add more midi tools to this
  17.  collection, maybe this posting will prompt a few more.  
  18.  
  19.  What it does:
  20.  
  21.   1) Record - Records midi data and TIMING between midi events and writes it
  22.               to stdout.  The timing is done using TICKS (60th's of a second)
  23.               via the DateStamp AMIGADOS call.  To do this I've introduced a
  24.               "new" midi message number, #defined as "TIMETAG".  All other
  25.               data recorded is pure midi data.  When a TIMETAG is found in
  26.               the stream, a 16 bit value is assumed to follow.  I know it's
  27.               probably not the best way to do it, but that's the way I did 
  28.               it.  
  29.  
  30.   2) Play -   The complement of "Record".  Play will take as input the ASCII
  31.               hex file created by "Record" and send it out the serial port
  32.               (hopefully via a MIDI I/F).  Play will interpret the TIMETAG
  33.               and wait between the MIDI commands so as to ATTEMPT to reproduce
  34.               the original timings.
  35.  
  36.    Under 1.2 you must set your serial port (via pref.) to be 31250 baud.  I
  37.    am using the 512 byte buffer size, I don't think you need more then this
  38.    as the programs are using the lowest level of I/O.  The one problem that
  39.    could possibly arise is due to the buffering of the serial device.  So 
  40.    far I haven't had any problems, but I think if you were to run a few other
  41.    tasks while using play/record, you may cause the serial device to start
  42.    buffering it's input.  In this case I think the timing's would start to
  43.    get out of sync with real-time, since the TIMETAG wouldn't reflect when
  44.    the data was actually read (record seems to keep up with the serial device
  45.    when there's nothing else going on). 
  46.  
  47.    As an aside, I usually run the programs under Matt Dillon's shell, with
  48.    the output going to RAM:,  haven't tried it with output going directly
  49.    to disk, but I would think it may make a difference it how accurate the
  50.    timings are, whenever the disk flushes the serial buffer may start to
  51.     back up, not sure.  I normally run them using a pipe like:
  52.  
  53.     % record | play
  54.  
  55.    and hit ^C to exit the record and start the playback. 
  56.  
  57.    Currently I'm working on a composite of both play and record that
  58.    allow you to control the entire DX-27 (DX-7 .. 100 etc) from the AMIGA.
  59.  
  60.    I was having some problems getting the DX to send the presets, but I
  61.    may have that solved.
  62.  
  63.    If anyone has any problems, I'll try to help, but I'm new at this stuff
  64.    too.  I'd like to talk to anyone interested in writing midi tools that
  65.    can be used together, maybe we can start some kind of a library ...
  66.  
  67.                                             Fred Cassirer
  68.  
  69.  
  70.